package novel.manager.service.impl.web;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import novel.manager.mapper.NovelMapper;
import novel.manager.pojo.web.Novel;
import novel.manager.service.iface.web.INovelService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class NovelServiceImpl implements INovelService {
	@Autowired
	private NovelMapper mapper;
	@Override
	public List<Novel> getsNovelByKeyword(String keyword) {
		keyword = "%" + keyword + "%";
		return mapper.getsNovelByKeyword(keyword);
	}
	@Override
	public List<Novel> getsNovelByKeyword(String keyword, int platformId) {
		Map<String, String> map = new HashMap<>();
		map.put("keyword", "%" + keyword + "%");
		map.put("platformId", platformId + "");
		return mapper.getsNovelByKeyword2(map);
	}

}
